package com.blog4j.user.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blog4j.api.vo.UserIllegalRecordVo;
import com.blog4j.user.entity.UserIllegalRecordEntity;
import com.blog4j.user.mapper.UserIllegalRecordMapper;
import com.blog4j.user.service.UserIllegalRecordService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author 98k灬
 * @version v1.0.0
 * @Description : 功能描述
 * @Create on : 2024/9/10 13:35
 **/
@Service
public class UserIllegalRecordServiceImpl extends ServiceImpl<UserIllegalRecordMapper, UserIllegalRecordEntity>
        implements UserIllegalRecordService {
    /**
     * 添加用户不合法记录
     *
     * @param userIllegalRecordVo 用户不合法记录请求体
     */
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    @Override
    public void addUserIllegalRecord(UserIllegalRecordVo userIllegalRecordVo) {
        UserIllegalRecordEntity illegalRecord = new UserIllegalRecordEntity();
        BeanUtils.copyProperties(userIllegalRecordVo, illegalRecord);
        this.baseMapper.insert(illegalRecord);
    }
}
